import Vue from 'vue'
import Router from 'vue-router'
import {setCookie,getCookie,delCookie} from "../cookie"
import FoodReport from '@/components/foodReport/FoodReport'
import GoodsClass from '@/components/goodsClass/GoodsClass'
import UserCenter from '@/components/userCenter/UserCenter'
import FoodWay from '@/components/foodReport/FoodsWay'
import FoodInfo from "@/components/food/FoodInfo"
import Login from "@/components/login/Login"
import Register from "@/components/login/Register"
import Address from "@/components/address/Address"
import Home from "@/components/home/Home"
import ShopCar from "@/components/shopCar/ShopCar"
import Add from "@/components/address/Add"
import Change from "@/components/address/ChangeAddress"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component:Add,
      meta:{requireAuth: false }
    },
    {
      path: '/login',
      component:Login,
      meta:{requireAuth: true }
    },
    {
      path: '/home',
      component: Home,
      meta:{requireAuth: false }
    },
    {
      path: '/class',
      component: GoodsClass,
      meta:{requireAuth: false }
    },
    {
      path: '/shopcar',
      component: ShopCar,
      meta:{requireAuth: false }
    },
    {
      path: '/menu',
      component: FoodReport,
      meta:{requireAuth: false }
    },
    {
      path: '/user',
      component: UserCenter,
      meta:{requireAuth: false }
    },
    {
      path:'/address',
      component:Address,
      meta:{requireAuth: true }

    },
    {
      path:'/register',
      component:Register,
      meta:{requireAuth: false }

    },
    {
      path:'/addaddress',
      component:Add,
      meta:{requireAuth: true }

    },
    {
      path:'/change',
      component:Change,
      meta:{requireAuth: true }

    },
  ],

})
